<template>
    <div class="goods-container">
        <h1>{{ desc.title }}</h1>
        <hr>
        <div v-html="desc.content" class="content"></div>
    </div>
</template>

<script>
    export default {
        name: "GoodsDesc",
        data() {
            return {
                desc: {}
            }
        },
        created() {
            this.getDesc()
        },
        methods: {
            getDesc() {
                this.$http.get('api/goods/getdesc/' + this.$route.params.id).then(result => {
                    if (result.body.status === 0) {
                        this.desc = result.body.message[0]
                    }
                })
            }
        }
    }
</script>

<style scoped lang="less">
    .goods-container {
        h1 {
            text-align: center;
            font-size: 16px;
            color: #26a2ff;
            margin: 15px 0;
        }

        .content {
            /deep/ p {
                padding: 0;
                margin: 0;

                img {
                    width: 100%;
                    display: block;
                }
            }

           /deep/
            tr{
               margin: 0;
               padding: 0;

               td {
                   margin: 0;
                   padding: 0;

                   img {
                       width: 100%;
                       display: block;
                   }
               }
           }
        }
    }
</style>